//mutations唯一的目的就是修改state中的状态（可以跟踪）
import {ADD_PRODUCT_COUNTER, ADD_PRODUCT_TO_CART} from "@/store/mutation-types";

export default {
  //购物车商品数量+1
  [ADD_PRODUCT_COUNTER](state, payload) {
    payload.count++;
  },
  //添加商品到购物车
  [ADD_PRODUCT_TO_CART](state, payload) {
    payload.count = 1;
    payload.isChecked = true;
    state.cartList.push(payload)
  }
}
